<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改密码</title>
<script type="text/javascript">
	$(function(){
		$("#form").validator({},{
			callback:function(results){
				art.dialog({
					lock:true,
				    content: '是否确定修改密码?',
				    ok: function () {
				    	$("#form").ajaxSubmit(function(data){
				    		 art.dialog({icon: data.success,content: data.message,lock:true});
				    		 $("#form").resetForm();
				    	});
				    },
				    cancelVal: '关闭',
				    cancel: true //为true等价于function(){}
				});
			}
		});
	});
	
	function confirm(dd,aa){
		var result = new Object();
		if($("#newPwd").val() != $("#confirm").val()){
			result.result =  false;
			result.msg = "新密码与确认密码不一致";
		}else{
			if($("#confirm").val() == $("#oldPwd").val()){
				result.result = false;
				result.msg = "新密码不能和旧密码相同";
			}else{
				result.result = true;
			}
		}
		return result;	
	}

</script>
</head>
<body>
<div class="modal" >
		<div class="modal-header r_location">
			<i class="r_txtico"></i> 运营管理 &gt; 修改密码
		</div>
		<div class="modal-body">
			<form method="post" action="user/modify_pwd" id="form">
				<ul class="all_list">
						<li><span class="all_title">旧密码：</span><span><input type="password" id="oldPwd" name="oldPwd" class="ui_input"  validator='{"label":"旧密码","maxLength":20,"isBLANK":true}'/></span></li>
						<li><span class="all_title">新密码：</span><span><input type="password" id="newPwd" name="newPwd" class="ui_input" validator='{"label":"新密码","minLength":6,"isBLANK":true}'/></span></li>
						<li><span class="all_title">确认新密码：</span><span><input type="password" id="confirm" name="confirm" class="ui_input" validator='{"label":"确认密码","minLength":6,"isBLANK":true,"customFun":"confirm"}'/></span></li>
						<li><span class="all_title"></span><span><input type="button"  value="修改" class="submitBtn save_btn" /></span></li>
					</ul>
			</form>
		</div>
		
		<!-- <div style="margin-left:30px;">提示: 本页面只能修改运营管理系统的密码, 域账号密码请到 <a href="https://chgpwd.sf-express.com:6498/" target="_blank">https://chgpwd.sf-express.com:6498/</a> 修改.</div> -->
	</div>
<script type="text/javascript">
	if("${msg}"=="1"){
		$('#errorMsg').html('旧密码不正确');
	}else if("${msg}"=="2"){
		$('#errorMsg').html('密码不能为空');
	}
</script>

</body>
</html>